﻿<Window x:Class="Controls.DataGridSample"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="DataGridSample" Height="356" Width="623">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="8*" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <DataGrid AutoGenerateColumns="False" Grid.ColumnSpan="4" Margin="5" Name="dgStudents" 
                  IsSynchronizedWithCurrentItem="True" AlternatingRowBackground="LightGray" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="Name" Binding="{Binding Name}"  Width="2*" />
                <DataGridComboBoxColumn Header="Gender" 
                                        ItemsSource="{Binding Source={StaticResource enumValues}}"
                                        SelectedValueBinding="{Binding Gender}"
                                        Width="*" />
                <DataGridCheckBoxColumn Header="Qualified?" Binding="{Binding IsQualified}"  Width="*"  />
                <DataGridTextColumn Header="Notes" Binding="{Binding Notes}" Width="4*"   />
            </DataGrid.Columns>
        </DataGrid>
        <Button Content="Info..." Grid.Column="3" Grid.Row="1"  Margin="5" Name="btnInfo" Click="btnInfo_Click" />
    </Grid>
</Window>
